<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/restrict/adminHome.xhtml">
	<ui:define name="titulo">
		<h:outputLabel value="MusicBay.com - #{msg.cadastrar} #{msg.genero}"/>
	</ui:define>

	<ui:define name="cont">
		<p:messages />
		<p:panel header="#{msg.cadastrar} #{msg.genero}">
			<h:form id="form">
				<h:panelGrid columns="3" cellpadding="7">

					<h:outputLabel value="#{msg.genero}" for="genero" class="label" />
					<h:panelGroup>
						<p:inputText value="#{generoManagedBean.genero.genero}" id="genero" label="#{msg.genero}"
							required="true" size="30" maxlength="30" requiredMessage="#{msg.genero} #{msg.naoInformado}">
							<f:validateLength minimum="2" maximum="30" />
						</p:inputText>
					</h:panelGroup>
					<p:message for="genero" />

					<p:commandButton id="showcadastroDialog" value="#{msg.cadastrar}" oncomplete="cadastroDialog.show()"
						icon="ui-icon-check" />

				</h:panelGrid>

				<p:confirmDialog id="cadastroDialog" message="#{msg.confirma} #{msg.cadastro}?"
					header="#{msg.confirma} #{msg.cadastro}?" severity="alert" widgetVar="cadastroDialog">

					<p:commandButton id="confirma" value="#{msg.confirma}" ajax="false"
						actionListener="#{generoManagedBean.actionSave}" oncomplete="cadastroDialog.hide()"
						icon="ui-icon-check" />
					<p:commandButton id="cancela" value="#{msg.cancelar}" onclick="cadastroDialog.hide()" type="button"
						icon="ui-icon-cancel" />
				</p:confirmDialog>
			</h:form>
		</p:panel>
	</ui:define>
</ui:composition>
</html>